package cn.com.chengmandian.core.web.utils;

import cn.com.chengmandian.core.web.pojo.AgentInfo;
import cn.com.chengmandian.core.web.pojo.CompanyInfo;

public class LocalMapUtil {
    // 租户信息
    private static ThreadLocal<AgentInfo> agent = new ThreadLocal<>();

    public static void setAgentInfo(AgentInfo agentInfo) {
        agent.set(agentInfo);
    }

    public static AgentInfo getAgentInfo() {
        return agent.get();
    }

    public static void removeAgentInfo() {
        agent.remove();
    }

    // 租户信息
    private static ThreadLocal<CompanyInfo> company = new ThreadLocal<>();

    public static void setCompanyInfo(CompanyInfo companyInfo) {
        company.set(companyInfo);
    }

    public static CompanyInfo getCompanyInfo() {
        return company.get();
    }

    public static void removeCompanyInfo() {
        company.remove();
    }
}
